package com.scott.crm.base.exception;

import com.scott.crm.base.utils.DataUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author 黄后林
 * @version 1.0
 * @note
 * @date 2021-12-05 09:48:04
 */
@RestControllerAdvice
@Slf4j
public class ControllerExceptionHandler {


    @ExceptionHandler
    public Object handleException(Exception exception){

        log.info("-----------------------发生异常咯 exception="+exception+"-------------------------");

        return  DataUtil.errors();
    }
}
